﻿<UserControl x:Class="TestCaseManagerApp.Views.TestCasesInitialView" Name="TestCaseInitialView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:local="clr-namespace:TestCaseManagerApp.Views"
             xmlns:entities="clr-namespace:TestCaseManagerCore.BusinessLogic.Entities;assembly=TestCaseManagerCore"    
              xmlns:convert="clr-namespace:TestCaseManagerCore.BusinessLogic.Converters;assembly=TestCaseManagerCore"
             mc:Ignorable="d" Loaded="TestCaseInitialView_Loaded">
    <Grid>
        <Grid.Resources>
            <convert:EnumMatchToBooleanConverter x:Key="enumBooleanConverter" />
        </Grid.Resources>
        <Grid.CommandBindings>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.EditCommand}" Executed="EditButton_Click"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.DuplicateCommand}" Executed="DuplicateButton_Click"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.PreviewCommand}" Executed="PreviewButton_Click"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.NewCommand}" Executed="btnNew_Click"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.CopyTestCasesCommand}" Executed="copyTestCases_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.CutTestCasesCommand}" Executed="cutTestCases_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.PasteTestCasesCommand}" Executed="pasteTestCases_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.RemoveCommand}" Executed="btnRemoveTestCase_Click"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.RemoveTestCaseFromSuiteCommand}" Executed="removeTestCaseFromSuite_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.RenameSuiteCommand}" Executed="renameSuite_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.AddSuiteCommand}" Executed="addSuite_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.RemoveSuiteCommand}" Executed="removeSuite_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.CopySuiteCommand}" Executed="copySuite_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.CutSuiteCommand}" Executed="cutSuite_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.PasteSuiteCommand}" Executed="pasteSuite_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.ExportTestCasesCommand}" Executed="btnExport_Click"/>

            <CommandBinding Command="{x:Static local:TestCasesInitialView.SetBlockedTestCasesCommand}" Executed="setBlocked_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.SetFailedTestCasesCommand}" Executed="setFailed_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.SetActiveTestCasesCommand}" Executed="setActive_Command"/>
            <CommandBinding Command="{x:Static local:TestCasesInitialView.SetPassedTestCasesCommand}" Executed="setPassed_Command"/>
        </Grid.CommandBindings>
        <ProgressBar Name="progressBar" Minimum="0" Maximum="1" Height="16" IsIndeterminate="True" Margin="0,0,0,16" />
        
        <Grid Name="mainGrid" Visibility="Hidden">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" MinWidth="65"/>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="6*" MinWidth="800"/>
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2">
                <TextBlock Text="Search Test Cases" Margin="0,0,10,15" Height="Auto" Width="Auto" FontWeight="Bold" FontSize="26" HorizontalAlignment="Left" Grid.Row="0"/>
            </StackPanel>

            <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="2">
                <StackPanel Orientation="Vertical" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="3" Margin="10,0,0,15">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,0,0,10">
                        <TextBlock Text="Selected Suite ID: " FontWeight="Bold" Margin="10,0,10,0" Height="Auto" Width="Auto" HorizontalAlignment="Left"/>
                        <TextBox Name="tbSuiteId"  Margin="10,0,10,10" Height="Auto" Width="50" HorizontalAlignment="Left" IsReadOnly="True"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,10" Name="spExecutionStatuses">
                        <RadioButton Content="All" Margin="20,0,10,0" FontWeight="Bold" FontSize="12" GroupName="Options1" IsChecked="{Binding Path=CurrentExecutionStatusOption, Mode=TwoWay, Converter={StaticResource enumBooleanConverter}, ConverterParameter=All}" Checked="RadioButton_Checked" />
                        <RadioButton Content="Active" Margin="15,0,10,0" FontWeight="Bold" FontSize="12" GroupName="Options2" IsChecked="{Binding Path=CurrentExecutionStatusOption, Mode=TwoWay, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Active}" Checked="RadioButton_Checked" />
                        <RadioButton Content="Passed" Margin="15,0,10,0" FontWeight="Bold" FontSize="12" GroupName="Options3" IsChecked="{Binding Path=CurrentExecutionStatusOption, Mode=TwoWay, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Passed}" Checked="RadioButton_Checked" />
                        <RadioButton Content="Failed" Margin="15,0,10,0" FontWeight="Bold" FontSize="12" GroupName="Options4" IsChecked="{Binding Path=CurrentExecutionStatusOption, Mode=TwoWay, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Failed}" Checked="RadioButton_Checked" />
                        <RadioButton Content="Blocked" Margin="15,0,10,0" FontWeight="Bold" FontSize="12" GroupName="Options5" IsChecked="{Binding Path=CurrentExecutionStatusOption, Mode=TwoWay, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Blocked}" Checked="RadioButton_Checked" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                        <Button Name="btnPreview1" Content="_Preview" Margin="20,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="PreviewButton_Click"/>
                        <Button Name="btnEdit1" Content="_Edit" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="EditButton_Click"/>
                        <Button Name="btnDuplicate1" Content="_Duplicate" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="DuplicateButton_Click"/>
                        <Button Name="btnNew1" Content="_New" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="btnNew_Click"/>
                        <Button Name="btnRemoveTestCase1" Content="_Remove" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="btnRemoveTestCase_Click"/>
                        <Button Name="btnExport" Content="_Export" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="btnExport_Click"/>
                        <Button Name="btnArrange" Content="Arrange" Margin="15,0,10,0" Height="30" Width="Auto" VerticalAlignment="Center" Click="btnArrange_Click"/>
                        <Button Name="btnChangeTestCases1" Content="Change Test Cases"  Margin="30,0,10,0" Height="30" Width="Auto" VerticalAlignment="Center" Click="btnChangeTestCases_Click"/>
                        <Button Name="btnShowTestCaseWithoutSuite" Content="Show Test Cases Without Suite" Margin="15,0,10,0" Height="30" Width="Auto" VerticalAlignment="Center" Click="btnShowTestCaseWithoutSuite1_Click"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="20,10,0,10">
                        <CheckBox Margin="0,0,10,0" VerticalAlignment="Center" HorizontalAlignment="Left" IsChecked="{Binding Path=ShowSubSuitesTestCases, Mode=TwoWay}" 
                                  Name="cbShowSubsuiteTestCases" Unchecked="cbShowSubsuiteTestCases_Unchecked"  Checked="cbShowSubsuiteTestCases_Checked"/>
                        <TextBlock Text="Show Test Cases in Subsuites" Margin="10,0,10,0" Height="Auto" Width="Auto" HorizontalAlignment="Left"/>                       

                    </StackPanel>
                </StackPanel>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.9*" />
                        <ColumnDefinition Width="6*" />
                        <!--<ColumnDefinition Width="4.8*" />-->
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="1.2*" />
                        <ColumnDefinition Width="1.4*" />
                    </Grid.ColumnDefinitions>
                    <TextBox Name="tbIdFilter" Text="{Binding InitialViewFilters.IdFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TabIndex="0" Margin="30,0,0,10" Height="25"
                             Grid.Column="0" GotFocus="tbIdFilter_GotFocus" LostFocus="tbIdFilter_LostFocus" KeyUp="tbIdFilter_KeyUp" />
                    <TextBox Name="tbTitleFilter" Text="{Binding InitialViewFilters.TitleFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TabIndex="1" Margin="10,0,0,10" Height="25"
                             Grid.Column="1" GotFocus="tbTitleFilter_GotFocus" LostFocus="tbTitleFilter_LostFocus" KeyUp="tbTitleFilter_KeyUp"/>
                    <!--<TextBox Name="tbSuiteFilter" Text="{Binding InitialViewFilters.SuiteFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TabIndex="2" Margin="10,0,0,10" Height="25" 
                             Grid.Column="2" GotFocus="tbTextSuiteFilter_GotFocus" LostFocus="tbSuiteFilter_LostFocus" KeyUp="tbSuiteFilter_KeyUp"/>-->
                    <TextBox Name="tbPriorityFilter" Margin="10,0,0,10" Height="25" Text="{Binding InitialViewFilters.PriorityFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TabIndex="3"
                             GotFocus="tbPriorityFilter_GotFocus"  LostFocus="tbPriorityFilter_LostFocus" KeyUp="tbPriorityFilter_KeyUp" Grid.Column="2" />
                    <TextBox Name="tbAssignedToFilter" Margin="10,0,0,10" Height="25" Text="{Binding InitialViewFilters.AssignedToFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TabIndex="4"
                             GotFocus="tbAssignedToFilter_GotFocus"  LostFocus="tbAssignedToFilter_LostFocus"  KeyUp="tbAssignedToFilter_KeyUp"  Grid.Column="3"/>
                    <StackPanel Orientation="Horizontal"  Grid.Column="4">
                        <CheckBox Margin="10,0,10,10" VerticalAlignment="Center" HorizontalAlignment="Left" IsChecked="{Binding Path=HideAutomated, Mode=TwoWay}" Name="cbHideAutomated" Unchecked="cbHideAutomated_Unchecked" Checked="cbHideAutomated_Checked"/>
                        <TextBlock Text="Hide Automated" Margin="0,10,10,10" Height="25" Width="Auto" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="12"/>                        
                    </StackPanel>
                </Grid>               
            </StackPanel>

            <TreeView  Name="tvSuites" Grid.Row="1" Grid.Column="0" Grid.RowSpan="2"  SelectedValuePath="Id" ItemsSource="{Binding Suites}" Margin="{StaticResource SplitLeft}">
                <TreeView.ItemContainerStyle>
                    <Style TargetType="{x:Type TreeViewItem}"  BasedOn="{StaticResource {x:Type TreeViewItem}}">
                        <Setter Property="IsExpanded" Value="{Binding Path=IsNodeExpanded, Mode=TwoWay}" />
                        <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
                        <EventSetter Event="TreeViewItem.PreviewMouseRightButtonDown" Handler="TreeViewItem_PreviewMouseRightButtonDown"/>
                        <EventSetter Event="TreeViewItem.KeyDown" Handler="tvSuites_KeyDown"/>
                        <EventSetter Event="TreeViewItem.Selected" Handler="treeViewItem_Selected"/>                       
                        <Setter Property="ContextMenu">
                            <Setter.Value>
                                <ContextMenu>                                    
                                    <MenuItem Command="{x:Static local:TestCasesInitialView.AddSuiteCommand}" Header="Add" IsEnabled="{Binding Path=IsAddEnabled}"/>                                    
                                    <Separator />
                                    <MenuItem Command="{x:Static local:TestCasesInitialView.CutSuiteCommand}" Header="Cut" IsEnabled="{Binding Path=IsCutEnabled}"/>
                                    <MenuItem Command="{x:Static local:TestCasesInitialView.CopySuiteCommand}" Header="Copy" IsEnabled="{Binding Path=IsCopyEnabled}"/>                                   
                                    <MenuItem Command="{x:Static local:TestCasesInitialView.PasteSuiteCommand}" Header="Paste" IsEnabled="{Binding Path=IsPasteEnabled}"/>
                                    <MenuItem Command="{x:Static local:TestCasesInitialView.RemoveSuiteCommand}" Header="Remove" IsEnabled="{Binding Path=IsRemoveEnabled}"/>
                                    <Separator />
                                    <MenuItem Command="{x:Static local:TestCasesInitialView.RenameSuiteCommand}" Header="Rename" IsEnabled="{Binding Path=IsRenameEnabled}"/>
                                </ContextMenu>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </TreeView.ItemContainerStyle>
                <TreeView.InputBindings>
                    <KeyBinding Key="C"  Modifiers="Ctrl"  Command="Copy"/>
                    <KeyBinding Key="V"  Modifiers="Ctrl"  Command="Paste"/>
                    <KeyBinding Key="X"  Modifiers="Ctrl"  Command="Cut"/>
                </TreeView.InputBindings>
                <TreeView.CommandBindings>
                    <CommandBinding Command="Copy"  Executed="copySuite_Command"/>
                    <CommandBinding Command="Paste"  Executed="pasteSuite_Command"/>
                    <CommandBinding Command="Cut"  Executed="cutSuite_Command"/>
                </TreeView.CommandBindings>
                <TreeView.Resources>                 
                    <HierarchicalDataTemplate DataType="{x:Type entities:Suite}" ItemsSource="{Binding SubSuites}" >                     
                        <TextBlock Text="{Binding Path=Title}" FontSize="14"/>
                        </HierarchicalDataTemplate>
                    </TreeView.Resources>
                </TreeView>

            <GridSplitter Width="5" ResizeDirection="Auto" HorizontalAlignment="Stretch"  VerticalAlignment="Stretch" Grid.Row="1" Grid.RowSpan="2" Grid.Column="1"/>

            <ProgressBar Name="progressBarTestCases" Minimum="0" Maximum="1" Height="16" IsIndeterminate="True" Margin="0,0,0,16" Grid.Row="2" Grid.Column="2" Visibility="Hidden"/>
           
            <DataGrid ItemsSource="{Binding Path=ObservableTestCases}" AutoGenerateColumns="False" Name="dgTestCases" Grid.Row="2" Grid.Column="2" 
                      IsReadOnly="True" SelectionMode="Extended"  SelectionUnit="FullRow" TabIndex="5"
                      SelectedCellsChanged="dgTestCases_SelectedCellsChanged" PreviewMouseRightButtonDown="dgTestCases_PreviewMouseRightButtonDown" Margin="{StaticResource SplitRight}">
                <DataGrid.ContextMenu>
                    <ContextMenu>
                        <MenuItem Name="dgTestCaseContextItemPreview" Command="{x:Static local:TestCasesInitialView.PreviewCommand}" Header="Preview"/>
                        <MenuItem Name="dgTestCaseContextItemEdit" Command="{x:Static local:TestCasesInitialView.EditCommand}" Header="Edit"/>
                        <MenuItem Name="dgTestCaseContextItemDuplicate" Command="{x:Static local:TestCasesInitialView.DuplicateCommand}" Header="Duplicate"/>                   
                        <Separator />
                        <MenuItem Name="dgTestCaseContextItemCut" Command="{x:Static local:TestCasesInitialView.CutTestCasesCommand}" Header="Cut"/>
                        <MenuItem Name="dgTestCaseContextItemCopy" Command="{x:Static local:TestCasesInitialView.CopyTestCasesCommand}" Header="Copy"/>                     
                        <MenuItem Name="dgTestCaseContextItemPaste" Command="{x:Static local:TestCasesInitialView.PasteTestCasesCommand}" Header="Paste"/>
                        <MenuItem Name="dgTestCaseContextItemRemove" Command="{x:Static local:TestCasesInitialView.RemoveTestCaseFromSuiteCommand}" Header="Remove"/>
                        <Separator />
                        <MenuItem Name="dgTestCaseContextItemActive" Command="{x:Static local:TestCasesInitialView.SetActiveTestCasesCommand}" Header="Reset test to Active"/>
                        <MenuItem Name="dgTestCaseContextItemPass" Command="{x:Static local:TestCasesInitialView.SetPassedTestCasesCommand}" Header="Pass test"/>
                        <MenuItem Name="dgTestCaseContextItemFail" Command="{x:Static local:TestCasesInitialView.SetFailedTestCasesCommand}" Header="Fail test"/>
                        <MenuItem Name="dgTestCaseContextItemBlock" Command="{x:Static local:TestCasesInitialView.SetBlockedTestCasesCommand}" Header="Block test"/>
                    </ContextMenu>
                </DataGrid.ContextMenu>
                <DataGrid.InputBindings>
                    <KeyBinding Key="C"  Modifiers="Ctrl"  Command="Copy"/>
                    <KeyBinding Key="V"  Modifiers="Ctrl"  Command="Paste"/>
                    <KeyBinding Key="X"  Modifiers="Ctrl"  Command="Cut"/>
                    <KeyBinding Key="D1"  Modifiers="Alt"  Command="{x:Static local:TestCasesInitialView.SetActiveTestCasesCommand}"/>
                    <KeyBinding Key="D2"  Modifiers="Alt"  Command="{x:Static local:TestCasesInitialView.SetPassedTestCasesCommand}"/>
                    <KeyBinding Key="D3"  Modifiers="Alt"  Command="{x:Static local:TestCasesInitialView.SetFailedTestCasesCommand}"/>
                    <KeyBinding Key="D4"  Modifiers="Alt"  Command="{x:Static local:TestCasesInitialView.SetBlockedTestCasesCommand}"/>
                </DataGrid.InputBindings>
                <DataGrid.CommandBindings>
                    <CommandBinding Command="Copy"  Executed="copyTestCases_Command"/>
                    <CommandBinding Command="Paste"  Executed="pasteTestCases_Command"/>
                    <CommandBinding Command="Cut"  Executed="cutTestCases_Command"/>
                </DataGrid.CommandBindings>
                <DataGrid.ItemContainerStyle>
                    <Style TargetType="{x:Type DataGridRow}"  BasedOn="{StaticResource {x:Type DataGridRow}}">
                        <EventSetter Event="MouseDoubleClick" Handler="dgTestCases_MouseDoubleClick" />
                        <EventSetter Event="PreviewKeyDown" Handler="dgTestCases_KeyDown" />
                    </Style>
                </DataGrid.ItemContainerStyle>

                <DataGrid.Columns>
                    <DataGridTextColumn Header="ID"  Binding="{Binding ITestCase.Id}" Width="0.6*">
                        <DataGridTextColumn.HeaderStyle>
                            <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                            </Style>
                        </DataGridTextColumn.HeaderStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Title" Binding="{Binding Title}" Width="6*">
                        <DataGridTextColumn.HeaderStyle>
                            <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                            </Style>
                        </DataGridTextColumn.HeaderStyle>
                        <DataGridTextColumn.CellStyle>
                            <Style TargetType="DataGridCell">
                                <Setter Property="ToolTip" Value="{Binding Title}" />
                            </Style>
                        </DataGridTextColumn.CellStyle>
                    </DataGridTextColumn>
                    <!--<DataGridTextColumn Header="Suite" Binding="{Binding ITestSuiteBase.Title}" Width="4.8*">
                        <DataGridTextColumn.HeaderStyle>
                            <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                            </Style>
                        </DataGridTextColumn.HeaderStyle>
                    </DataGridTextColumn>-->
                    <DataGridTextColumn Header="Priority" Binding="{Binding Priority}" Width="1*">
                        <DataGridTextColumn.HeaderStyle>
                            <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                            </Style>
                        </DataGridTextColumn.HeaderStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Assigned To" Binding="{Binding TeamFoundationIdentityName.DisplayName}" Width="1.2*">
                        <DataGridTextColumn.HeaderStyle>
                            <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                            </Style>
                        </DataGridTextColumn.HeaderStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Automated" Binding="{Binding ITestCase.IsAutomated}" Width="1.4*">
                        <DataGridTextColumn.HeaderStyle>
                            <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
                                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                            </Style>
                        </DataGridTextColumn.HeaderStyle>
                    </DataGridTextColumn>
                    </DataGrid.Columns>
            </DataGrid>

            <StackPanel Orientation="Vertical" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="3" Margin="10,10,0,0">
                
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <Button Name="btnPreview" Content="_Preview" Margin="20,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="PreviewButton_Click"/>
                    <Button Name="btnEdit" Content="_Edit" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="EditButton_Click"/>
                    <Button Name="btnDuplicate" Content="_Duplicate" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="DuplicateButton_Click"/>
                    <Button Name="btnNew" Content="_New" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="btnNew_Click"/>
                    <Button Name="btnRemoveTestCase" Content="_Remove" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="btnRemoveTestCase_Click"/>
                    <Button Name="btnExport1" Content="_Export" Margin="15,0,10,0" Height="30" Width="90" VerticalAlignment="Center" Click="btnExport_Click"/>
                    <Button Name="btnArrange1" Content="Arrange" Margin="15,0,10,0" Height="30" Width="Auto" VerticalAlignment="Center" Click="btnArrange_Click"/>
                    <Button Name="btnChangeTestCases" Content="Change Test Cases"  Margin="30,0,10,0" Height="30" Width="Auto" VerticalAlignment="Center" Click="btnChangeTestCases_Click"/>
                    <Button Name="btnShowTestCaseWithoutSuite1" Content="Show Test Cases Without Suite" Margin="15,0,10,0" Height="30" Width="Auto" VerticalAlignment="Center" Click="btnShowTestCaseWithoutSuite1_Click"/>
                </StackPanel>
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="3">
                <TextBlock Text="Selected Test Case Count:" Margin="30,30,10,0" Height="25" Width="Auto" FontWeight="Bold"/>
                <TextBlock Name="tbSelectedTestCaseCount"  Text="{Binding SelectedTestCasesCount}" Margin="0,30,10,0" Height="25" Width="Auto" />
                <TextBlock Text="Test Case Count:" Margin="0,30,10,0" Height="25" Width="Auto" FontWeight="Bold"/>
                <TextBlock Name="tbTestCaseCount"  Text="{Binding TestCasesCount}" Margin="0,30,10,0" Height="25" Width="Auto" />                
            </StackPanel>
        </Grid>
    </Grid>    
</UserControl>
